<?php

namespace Redis;

class QueueModel extends AbstractModel
{
    private static $_instance;

    public static function getInstance()
    {
        if (!(self::$_instance instanceof self)) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

    /**
     * 移除所有
     * @param $queue
     * @return int
     */
    public function remQueueAll($queue)
    {
        return $this->con->redis->zRemRangeByRank('queues:' . $queue . ':delayed',0,-1);
    }

    public function getQueueAll($queue)
    {
        return $this->con->redis->zRange('queues:' . $queue . ':delayed',0,-1,true);
    }

}
